package com.tengju.data.domain.model.clickhouse.subject;

import lombok.Getter;

import java.util.Arrays;

/**
 * @author chenhang
 * @Date 2021/4/22
 */
@Getter
public enum BonusSettleStatus {

    WAIT_SETTLE(10,"待结算"),
    SETTLED(20,"已结算"),
    ;

    int code;
    String desc;

    BonusSettleStatus(int code, String desc) {
        this.code = code;
        this.desc = desc;
    }

    public static BonusSettleStatus parse(int code) {
        return Arrays.stream(BonusSettleStatus.values())
                .filter(k -> k.getCode() == code)
                .findFirst().orElse(null);
    }
}
